<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2019/6/26
  Time: 14:51
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>门户管理</title>
    <%-- jquery --%>
    <script src="/static/js/jquery.min.js"></script>
    <%-- css --%>
    <link rel="stylesheet" href="/static/files/portalManage/styles.css">
    <%-- easyui --%>
    <link rel="stylesheet" type="text/css" href="/static/themes/default/easyui.css">
    <script type="text/javascript" src="/static/js/jquery.easyui.min.js"></script>
    <%--中文样式（不加就只能显示英文）--%>
    <script type="text/javascript" src="/static/js/easyui-lang-zh_CN.js"></script>
</head>
<body>
<div id="box">
    关键词:<input type="text" name="keywords" id="keywords">
    客户名称:<input type="text" name="customname" id="customname">
    <input type="button" id="find" value="查询">
</div>

<table id="showPortal">

</table>

</body>
<script>
    var keywords;
    var customname;

    show(keywords,customname);

    $("#find").click(function () {
        keywords = $("#keywords").val();
        customname = $("#customname").val();
        show(keywords,customname);
    })

    function show(keywords,customname) {
        var msg = "";
        if(keywords !="" && keywords != null){
            msg += "keywords="+keywords;
        }

        if(customname !="" && customname != null){
            if(msg != "" && msg !=null){
                msg += "&customname="+customname;
            }
            msg += "customname="+customname;
        }

        $("#showPortal").datagrid({
            url:"/showPortal?"+msg,
            pagination:true,
            pageSize:10,
            pageList:[5,10,15,20,25],
            fitColumns: true,// 拉宽
            singleSelect:true,
//        fit: true,  // 拉高度
            toolbar:".wu-toolbar-button",
            columns:[[
                {field:'id',title:'序号',width:15},
                {field:'keywords',title:'门户名称',width:60},
                {field:'customname',title:'客户名称',width:50},
                {field:'bossname',title:'法人代表',width:30},
                {field:'agentname',title:'代理商',width:50},
                {field:'regdatetime',title:'注册日期',width:70},
                {field:'customtypename',title:'类型',width:20},
                {field:'customstatus',title:'状态',width:20,formatter:function (customstatus) {
                    return customstatus==0?'禁用':'启用';
                }},
                {field:'caozuo',title:'操作',width:40,formatter:function (id, row, rowIndex) {
                    return "<a href='/menhuinfo?caozuo=look&id="+row.id+"'>查看</a>&nbsp;&nbsp;&nbsp;<a href='/menhuinfo?caozuo=uptate&id="+row.id+"'>修改</a>";
                }}
            ]]
        })
    }

</script>
</html>
